<?php

function GetQuota ($quota_username) {

include("globalVar.php");  //include for the $QUOTA_LOCATION

$result = "ErrorCode626";  //Standard error code

$QuotaFile = fopen($QUOTA_LOCATION, "r") or exit("Unable to open file!"); //Open file using $QUOTA_LOCATION

while(!feof($QuotaFile)) {  //reads quota.txt line by line

  $line = trim(fgets($QuotaFile));  //trims the line

  sscanf($line, $quota_username." %u", $quota);  //looks for quota_user followed by a number
  $result = $quota;

  }

fclose($QuotaFile);  //close file

return $result;  //return quota

}

//echo GetQuota("josh2010Quota"); for testing purposes

?>
